import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'models/counter_model.dart';
import 'pages/home_page.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Consumer<CounterModel>(
      builder: (context, model, child) {
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          theme: model.theme == "light"
              ? ThemeData.light()
              : ThemeData.dark(),
          home: const HomePage(),
        );
      },
    );
  }
}